<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix="c"%>

<h2>成绩列表</h2>
<a href="${pagecontext.request.contextPath}/toAddGrade">添加</a>
<a href="${pagecontext.request.contextPath}/listStudent">学生列表</a>
<table border="1">
    <tr>
        <td>ID</td>
        <td>学生ID</td>
        <td>课程名称</td>
        <td>成绩</td>
        <td>创建时间</td>
        <td>更新时间</td>
        <td>操作</td>
    </tr>
    <c:forEach items="${grades}" var="s" varStatus="st">
        <tr>
            <td>${s.id}</td>
            <td>${s.sid}</td>
            <td>${s.coursename}</td>
            <td>${s.score}</td>
            <td>${s.createdate}</td>
            <td>${s.updatedate}</td>
            <td>
                 <a href="${pageContext.request.contextPath}/deleteGrade?id=${s.id}">删除</a>
                 <a href="${pageContext.request.contextPath}/toUpdateGrade?id=${s.id}">修改</a>
            </td>
         </tr>
    </c:forEach>
</table>